//
//  CS_Page_TextFieldView.h
//  Pods
//
//  Created by 网新中研 on 2017/5/16.
//
//

#import <CSUIKit/CSUIKit.h>

/**
 * 视图类型
 */
typedef enum : NSUInteger {
    
    //页面视图类型
    CSTextFieldType_UserName = 1,
    CSTextFieldType_Password = 2,
    CSTextFieldType_Phone = 3,
    CSTextFieldType_Email = 4,
    CSTextFieldType_DateTime = 5,
    CSTextFieldType_Person = 6,
    CSTextFieldType_EnterpriseType = 7,
    CSTextFieldType_EnterpriseName = 8,
    CSTextFieldType_Address = 9,
    
    //明信片类型
    CSTextFieldType_Fax = 20,
    CSTextFieldType_PostCode = 21,
    CSTextFieldType_JobPosition = 22,
    
    //点击类型
    CSTextFieldType_Click = 31,
    
} CSTextFieldType;

@class CS_Page_TextFieldView;

typedef void(^TextFieldSelectBlock)(CS_Page_TextFieldView *page_TextFieldView);

typedef void(^TextFieldClickBlcok)(CS_Page_TextFieldView *page_TextFieldView);

typedef void(^TextFieldValueChangedBlcok)(CS_Page_TextFieldView *page_TextFieldView);

@interface CS_Page_TextFieldView : CSBaseView

@property (nonatomic, copy) TextFieldSelectBlock selectHandler;

@property (nonatomic, copy) TextFieldClickBlcok clickHandler;

@property (nonatomic, copy) TextFieldValueChangedBlcok valueChangedHandler;


/**
 * 加载textfield
 */
+(void)loadImageWithType:(CSTextFieldType)key value:(UIImage *)image;

@property (nonatomic, assign) CSTextFieldType textFieldType;

@property (nonatomic, assign) UIKeyboardType keyboardType;

@property (nonatomic, assign) BOOL isForbiddenEdit;

@property (nonatomic, strong) NSString *displayPlaceHolder;


//需要显示向下的箭头
@property (nonatomic, assign) BOOL isDownArrowRequired;

+(instancetype)textFiledWithPlaceHolder:(NSString *)placeHolder;

+(instancetype)textFiledWithPlaceHolder:(NSString *)placeHolder keyboardType:(UIKeyboardType)keyboardType;

+(instancetype)textFiledWithPlaceHolder:(NSString *)placeHolder keyboardType:(UIKeyboardType)keyboardType isPassword:(BOOL)isPassword;

+(instancetype)textFiledWithPlaceHolder:(NSString *)placeHolder keyboardType:(UIKeyboardType)keyboardType data:(NSString *)data;

//显示错误
-(void)showError;



@end

